﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MvcBlog.Common.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace MvcBlog.ViewModels
{
    public class LoginViewModel
    {
         public LoginViewModel()
        {
        }

        public LoginViewModel(User user, bool isAuth)
        {
            if (user != null)
            {
                this.User_ID = user.User_ID;
                this.UserName = user.Username;
                this.Password = user.Password;
                this.isAuthenticated = isAuth;
            }
        }

        public int User_ID { get; set; }

        [Required(ErrorMessage="Bitte geben Sie Ihren Benutzernamen ein")]
        [DisplayName("Benutzername")]
        public string UserName { get; set; }
        public bool isAuthenticated { get; set; }

        [Required(ErrorMessage = "Bitte geben Sie Ihr Passwort ein")]
        [DisplayName("Passwort")]
        public string Password { get; set; }
    }
}